<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<script type="text/javascript">
			
			var birth = new Date('2002-11-22');
			
			var date = new Date();
			date.setFullYear(2024);
			date.setMonth(3);
			date.setDate(30);
			
			var time = date.getTime() - birth.getTime();
			// var day = Math.floor(time / (1000 * 3600 * 24));
			var day = time / (1000 * 3600 * 24);
			
			alert("从出生到现在过了 " + day + " 天。");
			document.write("从出生到现在过了 " + day + " 天。");
			
		</script>
		
	</body>
</html>
